/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package quanlynhatre.Model;
import com.db4o.ObjectContainer;
import com.db4o.ObjectSet;
import com.db4o.query.Query;
import java.util.ArrayList;
import java.util.Date;
import quanlynhatre.Config.*;
/**
 *
 * @author VOTHUY
 */
public class NhanVien extends Nguoi {
    
    private String CMND;
    private String NoiCap;
    private Date NgayCap;
    private String SoDT;
    private String TrinhDo;
    private String ChucVu;
    private TrangThai TT;
    private float HeSoLuong;
    private float LuongCoBan;
    private int SNC;
    private Date NgayHL;
    
    private LopHoc daylop;
    //private ArrayList<CL_Hocky> dayhocky;
    //private ArrayList<CL_Namhoc> daynamhoc;
    
// Ham khoi tao
public NhanVien() {
    super();
// Ke thua
    }
public NhanVien(String id, String hoten,Date ngaysinh,String gioitinh,String dantoc, String tongiao,
        String cmnd, String noicap, Date ngaycap, String sodt, 
        String trinhdo, String chucvu, float hsl, float lcb, int snc, Date ngayhl) {
        super(id, hoten, ngaysinh,gioitinh,dantoc,tongiao);
        this.CMND = cmnd;
        this.NoiCap = noicap;
        this.NgayCap = ngaycap;
        this.SoDT = sodt;
        this.TrinhDo = trinhdo;
        this.ChucVu = chucvu;
        this.TT=new TrangThai();
        this.HeSoLuong = hsl;
        this.LuongCoBan = lcb;
        this.SNC = snc;
        this.NgayHL =  ngayhl;
        this.daylop = new LopHoc();this.HoTen = hoten;
        //this.dayhocky d= new ArrayList<CL_Hocky>();
        //this.daynamhoc = new ArrayList<CL_Namhoc>();
    }
public static NhanVien New()
{
    NhanVien nv = new NhanVien();
    nv.ID = "";
    nv.HoTen = "";
    nv.GioiTinh = "";
    nv.DanToc = "";
    nv.TonGiao = "";
    nv.CMND = "";
    nv.NoiCap = "";
    nv.SoDT = "";
    nv.TrinhDo = "";
    nv.ChucVu = "";
    nv.TT = new TrangThai();
    nv.HeSoLuong = 0;
    nv.LuongCoBan = 0;
    nv.SNC = 0;
    nv.dc = new DiaChi();
    nv.daylop = new LopHoc();
    return nv;
}
// Ham get, set
public String getCMND() {
        return CMND;
    }
public boolean setCMNN(String value) {
        if ( value.length() == 0 )
            javax.swing.JOptionPane.showMessageDialog(null, "CMND khong duoc phep de trong","Error", javax.swing.JOptionPane.WARNING_MESSAGE);
        else if ( value.length() > 50 )
            javax.swing.JOptionPane.showMessageDialog(null, "CMND khong duoc phep lon hon 50 ky tu","Error", javax.swing.JOptionPane.WARNING_MESSAGE);
        else
        {
            this.CMND = value;
            return true;
        }
        return false;
    }
public Date getNgayCap() {
        return NgayCap;
    }
public boolean setNgayCap(Date value) {
        if ( value.toString().length() == 0 )
            javax.swing.JOptionPane.showMessageDialog(null, "ID khong duoc phep de trong","Error", javax.swing.JOptionPane.WARNING_MESSAGE);
        
        else
        {
            this.NgayCap = value;
            return true;
        }
        return false;
    }
public String getNoiCap() {
        return NoiCap;
    }
public void setNoicap(String noicap) {
        this.NoiCap = noicap;
    }
public String getSoDT() {
        return SoDT;
    }
public void setSoDT(String sodt) {
        this.SoDT = sodt;
    }
public String getTrinhDo() {
        return TrinhDo;
    }
public void setTrinhDo(String trinhdo) {
        this.TrinhDo = trinhdo;
    }
public String getChucVu() {
        return ChucVu;
    }
public void setChucVu(String chucvu) {
        this.ChucVu = chucvu;
}
public float getLuongCoBan() {
        return LuongCoBan;
    }
public boolean setLuongCoBan(float value) {
        if ( value == 0 )
            javax.swing.JOptionPane.showMessageDialog(null, "Luong co ban khong duoc phep de trong","Error", javax.swing.JOptionPane.WARNING_MESSAGE);
        else if ( value < 0 )
            javax.swing.JOptionPane.showMessageDialog(null, "Luong co ban khong duoc phep nho hon 0","Error", javax.swing.JOptionPane.WARNING_MESSAGE);
        else
        {
            this.LuongCoBan = value;
            return true;
        }
        return false;
    }
public float getHeSoLuong() {
        return HeSoLuong;
    }
public boolean setHeSoLuong(int value) {
        if ( value == 0 )
            javax.swing.JOptionPane.showMessageDialog(null, "He so luong khong duoc phep de trong","Error", javax.swing.JOptionPane.WARNING_MESSAGE);
        else if ( value < 0 )
            javax.swing.JOptionPane.showMessageDialog(null, "He so luong khong duoc phep nho hon 0","Error", javax.swing.JOptionPane.WARNING_MESSAGE);
        else
        {
            this.HeSoLuong = value;
            return true;
        }
        return false;
}
public int getSNC() {
        return SNC;
    }
public void setSNC(int snc) {
        this.SNC = snc;
}
public Date getNgayHL() {
        return NgayHL;
    }
public void setNgayHL(Date ngayhl) {
        this.NgayHL = ngayhl;
    }
public TrangThai getTrangthai(){
    return TT;
    }
public void setTT(TrangThai trangthai) {
        this.TT = trangthai;
    }
public LopHoc getDaylop() {
        return daylop;
    }
public void setDaylop(LopHoc daylop) {
        this.daylop = daylop;
    }
      
}
